import http from '@/utils/request'

// 注册用户  API 封装
/***** 用户(User) 模块 *******/
//===============================================
// 用户列表（分页） GET /page
// 参数名	参数说明	备注
// 页号   pageIndex
// 页大小 pageSize
// 搜索 keyword (在用户名中匹配)
// 排序 orderBy
export function getUserList(params) {
  let {pageIndex,pageSize,keyword,orderBy} = params;
	return http.request({
		url: "/user/page",
		method: "get",
		params: {pageIndex,pageSize,keyword,orderBy},
	});
}

//删除用户By用户Id		GET /delete
export function  deleteUserById(id) {
	return http.request({
		url: "/user/delete",
		method: "get",
		params: {id},
	});
}

//修改用户		POST /update
export function  updateUser(params) {
	return http.request({
		url: "/user/update",
		method: "post",
		data: params,
	});
}

// 查询用户ById GET /detail
export function getDetailById(id) {
	return http.request({
		url: "/user/detail",
		method: "get",
		params: {id},
	});
}

//重置用户密码By用户Id		GET /resetPassword
export function  resetUserPasswordById(id,password) {
	return http.request({
		url: "/user/resetPassword",
		method: "post",
		data: {id,password},
	});
}
